import Axios from 'axios'
import Vue from 'vue'
var loading
Axios.interceptors.request.use((config) => {
  loading = Vue.prototype.$loading({
    lock: true,
    text: '拼命加载中',
    spinner: 'el-icon-loading',
    background: 'rgba(0,0,0,0.8)'
  })
  return config
}, (err) => {
  return Promise.reject(err)
})
// 添加 响应拦截器
Axios.interceptors.response.use((res) => {
  loading && loading.close()
  return res
}, (err) => {
  return Promise.reject(err)
})
